/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function myFunction()
{

    var input_lpg = document.getElementById('conlpg');
    var input_chips = document.getElementById('conchips');
    var useday = document.getElementById('useday');
    var formonth = document.getElementById('formonth');

    input_lpg.onkeyup = function() {
        document.getElementById('loutput').innerHTML = input_lpg.value;
        updateTotalL();
    }
    useday.onkeyup = function() {
        document.getElementById('loutputhr').innerHTML = useday.value;
        document.getElementById('goutputhr').innerHTML = useday.value;
        updateTotalL();
        updateTotalG();
    }
    formonth.onkeyup = function() {
        document.getElementById('loutputd').innerHTML = formonth.value;
        updateTotalL();
        updateTotalG();
    }


// Gasifier Section
    input_chips.onkeyup = function() {
        document.getElementById('goutput').innerHTML = input_chips.value;
        updateTotalG();
    }
}

function updateTotalL() {
    var input_lpg = document.getElementById('conlpg').value;
    var useday = document.getElementById('useday').value;
    total = input_lpg * useday * 30;
    document.getElementById('loutput').innerHTML = input_lpg;
    document.getElementById('loutputhr').innerHTML = useday;
    document.getElementById('loutputtotal').innerHTML = total;

}

function updateTotalG() {
    var cinput_lpg = document.getElementById('conchips').value;
    var cuseday = document.getElementById('useday').value;
    ctotal = cinput_lpg * cuseday * 30;
    document.getElementById('goutput').innerHTML = cinput_lpg;
    document.getElementById('loutputhr').innerHTML = cuseday;
    document.getElementById('goutputtotal').innerHTML = ctotal;

}